package com.mk.admin.controller;

import com.mk.admin.model.ResultDto;
import com.mk.admin.model.vo.MessageReadVo;
import com.mk.admin.service.MessageReadService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/a/adm/messageRead")
@Api(tags = "消息已读")
public class MessageReadController {
    @Autowired
    private MessageReadService messageReadService;

    @PostMapping("/select")
    public ResultDto select(@RequestBody MessageReadVo vo) {
        return messageReadService.select(vo);
    }

    @PostMapping("/selectNotReadPat")
    public ResultDto selectNotReadPat(@RequestBody MessageReadVo vo) {
        return messageReadService.selectNotReadPat(vo);
    }

    @PostMapping("/selectNotReadCountPat")
    public ResultDto selectNotReadCountPat(@RequestBody MessageReadVo vo) {
        return messageReadService.selectNotReadCountPat(vo);
    }

    @PostMapping("/add")
    public ResultDto add(@RequestBody MessageReadVo vo) {
        return messageReadService.add(vo);
    }

    @PostMapping("/addBatch")
    public ResultDto addBatch(@RequestBody MessageReadVo vo) {
        return messageReadService.addBatch(vo.getList());
    }

    @PostMapping("/update")
    public ResultDto update(@RequestBody MessageReadVo vo) {
        return messageReadService.update(vo);
    }

    @PostMapping("/delete")
    public ResultDto delete(@RequestBody MessageReadVo vo) {
        return messageReadService.delete(vo.getId());
    }

    @PostMapping("/status")
    public ResultDto status(@RequestBody MessageReadVo vo) {
        return messageReadService.status(vo.getId());
    }

}
